<!--
 * @Author: your name
 * @Date: 2020-01-27 17:43:51
 * @LastEditTime: 2020-05-05 13:35:37
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \vue-element-admin\src\views\dashboard\index.vue
 -->
<template>
  <div class="dashboard-container">
    <component :is="currentRole" />
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import adminDashboard from './admin'
// import safeManagerDashboard from './safeManager'
// import businessAdminDashboard from './businessAdmin'
// import checkPersonDashboard from './checkPerson'

export default {
  name: 'Dashboard',
  components: {
    adminDashboard
    // safeManagerDashboard,
    // businessAdminDashboard,
    // checkPersonDashboard
  },
  data() {
    return {
      currentRole: 'adminDashboard'
    }
  },
  computed: {
    ...mapGetters(['roles'])
  },
  created() {
    // if (!this.roles.includes('admin')) {
    //   if (this.roles.includes('safeManager')) {
    //     //判断是否是企业安全员
    //     this.currentRole = 'safeManagerDashboard'
    //   } else if (this.roles.includes('businessAdmin')) {
    //     //判断是否是业务管理员
    //     this.currentRole = 'businessAdminDashboard'
    //   } else {
    //     //判断是否是检查人员
    //     this.currentRole = 'checkPersonDashboard'
    //   }
    // }
  }
}
</script>
